package com.imooc.service;

import com.imooc.domain.Employee;
import com.imooc.repository.EmployeeCrudRepository;
import com.imooc.repository.EmployeeRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

/**
 * @ClassName EmployeeService
 * @Description TODO
 * @Author Wxg
 * @Date 2018/11/17 6:32
 * @Version 1.0
 */
@Service
public class EmployeeService {

    @Autowired
    EmployeeRepository employeeRepository;

    @Autowired
    EmployeeCrudRepository employeeCrudRepository;

    @Transactional
    public void update1(Integer id, Integer age){
        employeeRepository.update1(id, age);
    }

    @Transactional
    public void save(List<Employee> employees) {
        employeeCrudRepository.save(employees);
    }
}
